package com.huaboot.system.demo.rangesearch;

import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * description: ShopController
 * date: 2023/10/12 16:15
 * author: ff
 */
@RestController
public class ShopController {

    @Autowired
    private ShopService shopService;

        @GetMapping("/syncShopLocationToRedis")
    public void syncShopLocationToRedis(){
        shopService.syncShopLocationData();
    }
    @GetMapping("/getShopListByLocation")
    public List<Shop> getShopListByLocation(){
        //模拟用户信息
        Map<String,Object> user = new HashMap<>();
        user.put("accuracy",70.361239);
        user.put("latitude",67.115126);
        user.put("name","李祥");
        user.put("id", UUID.randomUUID().toString().replace("-",""));
        return shopService.getShopListByLocation(user);
    }


}
